package com.lcj.eduCms.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lcj.commonutils.R;
import com.lcj.eduCms.entity.CrmBanner;
import com.lcj.eduCms.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author：LCJ
 * @Description：
 * @Date：Create in 13:50 2021/3/22 0022
 */
@RestController
@RequestMapping("/eduCms/banner")
@CrossOrigin
public class BannerApiController {

    @Autowired
    private CrmBannerService bannerService;



    //获取前两条banner数据
    @GetMapping("getAllBanner")
    public R index(){
        List<CrmBanner> list =bannerService.selectBanners();
        return R.ok().data("bannerList",list);
    }



}
